# -*- coding: utf-8 -*-

from GKModel.BaseModel import BaseModel
from GKModel.Client import Client


class AuthModel(BaseModel):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.__client = Client(**kwargs)
        client = self.__client.query_account()
        if client is None:
            raise ValueError(1000023, 'Please Login')

        self.__account = client[0][1]
        self.__uid = client[1][1]

    @property
    def client(self):
        return self.__client

    @property
    def account(self):
        return self.__account

    @property
    def uid(self):
        return self.__uid
